var base = "http://127.0.0.1:81";

window.httpGet = function (url, callBack) {
  //生成函数名称
  function get(url, callBackTemp) {
    //设置全局函数
    //回调请求
    //开始发起网络请求
    axios.get(base+url)
      .then((res) => {
        callBackTemp(res.data);
      });
  }
  get(url, (res) => {
    callBack(res);
  });

};

window.httpPost = function (url, param, callBack) {
  //生成函数名称
  function get(url, callBackTemp) {
    //设置全局函数
    //回调请求
    //开始发起网络请求
    axios({
      method: "post",
      url: base+url,
      data: param,
      headers: {
        "Content-type": "application/x-www-form-urlencoded",
      },
    }).then((res) => {
      callBackTemp(res.data);
    });
  }
  get(url, (res) => {
    callBack(res);
  });
};
